<template>
	<view class="page">
		<view class="prescript-head">
			<view class="content-text">{{ prescript.patientInfo.name }}</view>
			<view class="patient-info">
				<text>{{ prescript.patientInfo.age }}岁</text>
				<text>{{ prescript.patientInfo.sex | sexFilter}}</text>
				<text>{{ prescript.patientInfo.phone}}</text>
			</view>
			<view class="diagnosis-info" v-for="(item,index) in prescript.diagnosisInfo" :key="index">
				<text>{{ item.title }}</text>
				<text>{{ item.body }}</text>
			</view>
			<view class="diagnosis-info">
				<text>处方</text>
			</view>
			<view class="order-prescript-detail">
				<view>
					<text v-for="(item,index) in prescript.prescript" :key="index">{{ item }}</text>
				</view>
				<view class="order-prescript-pay">购买后即可查看完整处方</view>
			</view>
		</view>
		<view class="prescript-other">
			<view class="other-info" v-for="(item,index) in prescript.otherInfo" :key="index">
				<text>{{ item.title }}</text>
				<text>{{ item.body }}</text>
			</view>
			<view class="tips">
				温馨提示:{{ prescript.tips }}
			</view>
		</view>
		<view class="bottom-button" @tap="navigateTo">
			立即购药
		</view>
	</view>
</template>

<script>
	export default {
		filters:{
			sexFilter(value){
				return value == "0" ? "男" : "女";
			}
		},
		data() {
			return {
				prescript: {
					patientInfo:{
						name:"李强",
						age:"24",
						sex:"0",
						phone:"13020019540"
					},
					diagnosisInfo:[{title:"主诉",body:"腰疼"},{title:"诊断",body:"寒湿痹痛，内有积热"},{title:"类型",body:"中草药（中药饮片-康美）"}],
					prescript: ["黄芩", "甘草", "法半夏", "醋柴胡", "羌活", "苍术", "桂枝", "川牛膝", "虎杖", "麻黄", "大黄"],
					otherInfo:[{title:"服用方法",body:"内服。共6贴，每日1贴，1贴分2次服用。"},{title:"医嘱",body:"饭后一小时服，忌生冷，忌烟酒，忌油腻。"}],
					tips:"每次问诊后，您都有5次诊后咨询(向医生提问5次)的权力，及时与医生沟通，谨遵医嘱服药，才能获得更好的疗效。"
				}
			}
		},
		methods: {
			navigateTo() {
				uni.navigateTo({
					url: 'drugOrder'
				})
			}
		}
	}
</script>

<style>
	.page {
		background-repeat: no-repeat;
		background-size: cover;
		/* background-image: url("~http://yao.hayzon.com/static/temp/222.png"); */
		height: 100%;
	}

	.prescript-head,.prescript-other {
		margin-top: 10upx;
		padding: 35upx;
		background-color: #ffffff;
	}

	.content-text,
	.patient-info text,
	.diagnosis-info text:last-child,.other-info text:last-child {
		color: #333333;
		font-size: 1.2em;
		/* font-weight: bold */;
	}

	.patient-info text,.other-info  {
		margin-right: 40upx;
	}

	.patient-info text:last-child {
		color: #0000ff;
		text-decoration: underline;
		font-size: 1em;
	}

	.diagnosis-info text:first-child,.other-info text:first-child {
		color: #666666;
		font-size: 1.2em;
		margin-right: 40upx;
	}

	.order-prescript-detail {
		background-repeat: no-repeat;
		background-size: 100%;
		background-image: url("~http://yao.hayzon.com/static/orderDetail/boxBackground.png");
	}

	.order-prescript-detail view:first-child {
		display: flex;
		flex-wrap: wrap;
		padding-top: 20upx;
		padding-left: 50upx;
		padding-bottom: 35upx;
	}

	.order-prescript-detail view:first-child text {
		font-size: 1.2em;
		margin-right: 25upx;
		/* font-weight: bold; */
	}

	.order-prescript-pay {
		color: #999999;
		text-align: center;
		line-height: 1.5;
		font-size: 1.1em;
	}
	.other-info{
		display:flex;
		flex-direction: row;
	}
	.other-info text:first-child{
		flex-shrink: 0;
		width:140upx;
	}
	.tips{
		color:#da6b57;
		font-size:1.1em;
	}
	.bottom-button{
		background-color:#e56653;
		line-height: 100upx;
		color:#fff0fa;
		font-size:1.5em;
		text-align: center;
		position: fixed;
		bottom:0;
		left:0;
		right:0;
	}
</style>
